package com.rongzhe.house.entity;

import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.List;

/**
 * Created by huang on 2017/12/4.
 */

public class HouseCriteriaTo {
    private String provinceId;

    private String cityId;

    private String countyId;

    private String route;

    private BigDecimal rentStart;

    private BigDecimal rentEnd;

    private Boolean entireRent;
    private Boolean ownerRent;
    private Boolean findRound;
    private Boolean apartment;
    private Double lat;
    private Double lon;

    private String roomNum;

    private List<Integer> tags;

    private String enterTime;

    private int pageSize;

    private int currentPage;

    private String keyword;
    private String regionFinal;
    private List<String> roomNumList = new ArrayList<>();

    @Override
    public String toString() {
        return "HouseCriteriaTo{" +
                "provinceId='" + provinceId + '\'' +
                ", cityId='" + cityId + '\'' +
                ", countyId='" + countyId + '\'' +
                ", route='" + route + '\'' +
                ", rentStart=" + rentStart +
                ", rentEnd=" + rentEnd +
                ", entireRent=" + entireRent +
                ", ownerRent=" + ownerRent +
                ", findRound=" + findRound +
                ", apartment=" + apartment +
                ", lat=" + lat +
                ", lon=" + lon +
                ", roomNum='" + roomNum + '\'' +
                ", tags=" + tags +
                ", enterTime='" + enterTime + '\'' +
                ", pageSize=" + pageSize +
                ", currentPage=" + currentPage +
                ", keyword='" + keyword + '\'' +
                ", regionFinal='" + regionFinal + '\'' +
                ", roomNumList=" + roomNumList +
                '}';
    }

    public Boolean getApartment() {
        return apartment;
    }

    public void setApartment(Boolean apartment) {
        this.apartment = apartment;
    }

    public List<String> getRoomNumList() {
        return roomNumList;
    }

    public Boolean getFindRound() {
        return findRound;
    }

    public void setFindRound(Boolean findRound) {
        this.findRound = findRound;
    }

    public Double getLat() {
        return lat;
    }

    public void setLat(Double lat) {
        this.lat = lat;
    }

    public Double getLon() {
        return lon;
    }

    public void setLon(Double lon) {
        this.lon = lon;
    }

    public String getRegionFinal() {
        return regionFinal;
    }

    public void setRegionFinal(String regionFinal) {
        this.regionFinal = regionFinal;
    }

    public String getKeyword() {
        return keyword;
    }

    public void setKeyword(String keyword) {
        this.keyword = keyword;
    }

    public Boolean getOwnerRent() {
        return ownerRent;
    }

    public void setOwnerRent(Boolean ownerRent) {
        this.ownerRent = ownerRent;
    }

    public String getEnterTime() {
        return enterTime;
    }

    public void setEnterTime(String enterTime) {
        this.enterTime = enterTime;
    }

    public int getPageSize() {
        return pageSize;
    }

    public void setPageSize(int pageSize) {
        this.pageSize = pageSize;
    }

    public int getCurrentPage() {
        return currentPage;
    }

    public void setCurrentPage(int currentPage) {
        this.currentPage = currentPage;
    }

    public String getProvinceId() {
        return provinceId;
    }

    public void setProvinceId(String provinceId) {
        this.provinceId = provinceId;
    }

    public String getCityId() {
        return cityId;
    }

    public void setCityId(String cityId) {
        this.cityId = cityId;
    }

    public String getCountyId() {
        return countyId;
    }

    public void setCountyId(String countyId) {
        this.countyId = countyId;
    }

    public String getRoute() {
        return route;
    }

    public void setRoute(String route) {
        this.route = route;
    }

    public BigDecimal getRentStart() {
        return rentStart;
    }

    public void setRentStart(BigDecimal rentStart) {
        this.rentStart = rentStart;
    }

    public BigDecimal getRentEnd() {
        return rentEnd;
    }

    public void setRentEnd(BigDecimal rentEnd) {
        this.rentEnd = rentEnd;
    }

    public Boolean getEntireRent() {
        return entireRent;
    }

    public void setEntireRent(Boolean entireRent) {
        this.entireRent = entireRent;
    }

    public String getRoomNum() {
        return roomNum;
    }

    public void setRoomNum(String roomNum) {
        this.roomNum = roomNum;
    }

    public List<Integer> getTags() {
        return tags;
    }

    public void setTags(List<Integer> tags) {
        this.tags = tags;
    }

    public void setAsEntireRent(Boolean entireRent) {
        if (entireRent) {
            cleanAllType();
        }
        setEntireRent(entireRent);
    }

    public void setAsOwnerRent(Boolean direct) {
        if (direct) {
            cleanAllType();
        }
        setOwnerRent(direct);
    }

    public void setAsApartMent(Boolean apartment) {
        if (apartment) {
            cleanAllType();
        }
        setApartment(apartment);
    }

    private void cleanAllType() {
        setEntireRent(null);
        setOwnerRent(null);
        setApartment(null);
    }
}
